package pack1021;

public class DemoC {

    public void play() {
        System.out.println("小明一个人看电影");
    }

    public void play(String name) {
        System.out.println("小明和" + name + "一起去逛街");
    }

    /*public void play(String[] names) {
        System.out.print("小明和");
        for (int i = 0; i < names.length; i++) {
            System.out.print(names[i] + ",");
        }
        System.out.println("\b一起去唱歌！");
    }*/
    public void play(String... names) {
        System.out.print("小明和");
        for (int i = 0; i < names.length; i++) {
            System.out.print(names[i] + ",");
        }
        System.out.println("\b一起去唱歌！");
    }

    public static void main(String[] args) {
        DemoC c = new DemoC();
        /*String[] array = {"张三","李四","王五"};
        c.play(array);*/
        c.play("张三", "李四", "王五", "麻溜");
    }
}